#include<bits/stdc++.h>
#define int long long
using namespace std;
const int Maxn = 100010, mod = 1e9 + 7;
int n, m, X, y, ans;
int ksm(int x, int y){
	int s = 1;
	while(y){
		if(y & 1) s = s * x % mod;
		x = x * x % mod;
		y >>= 1;
	}
	return s;
}
int vis[Maxn];
void dfs(int x){
	if(x > n){
		int sum = 0;
		for(int i = 1 ; i < n ; i++){
			sum = sum ^ (vis[i] * vis[i + 1]);
		}
		sum %= m;
		ans = (ans + sum) % mod;
		return ;
	}
	if(x == X){
		vis[x] = y;
		dfs(x + 1);
		return ;
	}
	for(int i = 0 ; i < m ; i++){
		vis[x] = i;
		dfs(x + 1);
	}
}
signed main(){
	ios::sync_with_stdio(false);
	freopen("pearl.in", "r", stdin);
	freopen("pearl.out", "w", stdout);
	cin >> n >> m >> X;
	for(int i = 1 ; i <= m ; i++){
		char x;
		cin >> x;
		y += (x - '0') * ksm(2, i - 1);
	}
	m = ksm(2, m);
	dfs(1);
	cout << ans << '\n';
	return 0;
}